-
Notifications
You must be signed in to change notification settings - Fork 8k
Support Renesas RA SCI I2C driver #96558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support Renesas RA SCI I2C driver #96558
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
sci2_default: sci2_default { | ||
group1 { | ||
/* sda scl */ | ||
psels = <RA_PSEL(RA_PSEL_SCI_2, 1, 12)>,<RA_PSEL(RA_PSEL_SCI_2, 1, 13)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should follow the file style
psels = <RA_PSEL(RA_PSEL_SCI_2, 1, 12)>,<RA_PSEL(RA_PSEL_SCI_2, 1, 13)>; | |
psels = <RA_PSEL(RA_PSEL_SCI_2, 1, 12)>, | |
<RA_PSEL(RA_PSEL_SCI_2, 1, 13)>; |
sci2_default: sci2_default { | ||
group1 { | ||
/* sda scl */ | ||
psels = <RA_PSEL(RA_PSEL_SCI_2, 1, 12)>,<RA_PSEL(RA_PSEL_SCI_2, 1, 13)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
psels = <RA_PSEL(RA_PSEL_SCI_2, 1, 12)>,<RA_PSEL(RA_PSEL_SCI_2, 1, 13)>; | |
psels = <RA_PSEL(RA_PSEL_SCI_2, 1, 12)>, | |
<RA_PSEL(RA_PSEL_SCI_2, 1, 13)>; |
5cde92d
to
3fa6d4b
Compare
3fa6d4b
to
3ec8211
Compare
if I2C_RENESAS_RA_SCI | ||
config I2C_RENESAS_RA_SCI_DTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to add a blank line between if *
and the following code
|
||
#define I2C_MAX_MSG_LEN (1 << (sizeof(uint8_t) * 8)) | ||
|
||
typedef void (*init_func_t)(const struct device *dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This typedef is not used anywhere. It should be removed
R_SCI_I2C_Close(&data->ctrl); | ||
R_SCI_I2C_Open(&data->ctrl, &data->i2c_config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error code should be checked
struct sci_i2c_data *data = (struct sci_i2c_data *const)dev->data; | ||
*dev_config = data->dev_config; | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a blank line after the variable declaration.
|
||
/* Set destination address with configured address mode before sending msg. */ | ||
|
||
i2c_master_addr_mode_t addr_mode = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable declaration should be moved to the top of the code block. The initial value does not need to be assigned.
struct sci_i2c_data *data = dev->data; | ||
fsp_err_t fsp_err; | ||
struct i2c_msg *current, *next; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blank line should be removed
void *p_context) | ||
{ | ||
struct sci_i2c_data *data = dev->data; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blank line should be removed
fsp_err_t fsp_err; | ||
int ret; | ||
|
||
data->dev_config |= I2C_MODE_CONTROLLER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoud it be =
instead of |=
?
properties: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties: | |
properties: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to re-run clang-format for this file
You will need to rebase to pass this job. |
First commit to add support for Renesas RA i2c sci driver Signed-off-by: Khai Cao <[email protected]>
Add I2C device nodes for the SCI peripheral on RA6 series Signed-off-by: Khai Cao <[email protected]>
Add I2C device nodes for the SCI peripheral on RA4 series Signed-off-by: Khai Cao <[email protected]>
Add I2C device nodes for the SCI peripheral on RA2 series Signed-off-by: Khai Cao <[email protected]>
Enable support of i2c sci driver on these boards: ek_ra6m5, ek_ra6m4 Signed-off-by: Khai Cao <[email protected]>
Add board support for EK_RA6M5, EK_RA6M4 i2c test use sci_i2c: - tests/drivers/i2c/i2c_api Example for i2c use sci_i2c: west build -b ek_ra6m5 tests/drivers/i2c/i2c_api/ -p always \ -DDTC_OVERLAY_FILE=boards/ek_ra6m5_sci_i2c.overlay \ -DCONF_FILE="boards/ek_ra6m5_sci_i2c.conf" Signed-off-by: Khai Cao <[email protected]>
3ec8211
to
b737861
Compare
|
This PR add support for SCI I2C driver on RA devices